﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Multiprocessing.Core.Mathematics.Graphs
{
    public class DirectionalRib<TNodeKey, TNodeValue, TRibValue>
    {
        #region Properties

        public TRibValue Weight { get; set; }

        public GraphNode<TNodeKey, TNodeValue, TRibValue> From { get; private set; } 

        public GraphNode<TNodeKey, TNodeValue, TRibValue> To { get; private set; }

        #endregion

        #region Constructors

        public DirectionalRib(TRibValue weight, GraphNode<TNodeKey, TNodeValue, TRibValue> @from, GraphNode<TNodeKey, TNodeValue, TRibValue> @to)
        {
            this.Weight = weight;
            if (ReferenceEquals(@to, null))
            {
                throw new ArgumentNullException("to");
            }
            this.To = to;
            if (ReferenceEquals(@from, null))
            {
                throw new ArgumentNullException("from");
            }
            this.From = from;
        }

        #endregion
    }
}
